﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CaliburnWpf.ViewModels
{
    using MoneyManagerNET.Model;

    public class DesignTimeViewModelSupplier
    {
        static DesignTimeViewModelSupplier() { 
            
        }

        public static HomeViewModel Home {
            get {
                var vm = new HomeViewModel();
                return vm;
            }
        }

        public static ShellViewModel Main {
            get {
                var vm = new ShellViewModel();
                //vm.SelectNode(((IEnumerable<IBankAccount>)vm.BankAccounts).First(), "BankAccount");
                return vm;
            }
        }
        
        //public static BankAccountViewModel BankAccount
        //{
        //    get
        //    {
        //        var bank_account= App.Storage.Select<IBankAccount>().FirstOrDefault(); 
        //        var vm= new BankAccountViewModel(){Model=bank_account};
        //        vm.Filter = vm.FilterList[1];
        //        return vm;
        //    }
        //}
        
        //public static TransactionViewModel Transaction {
        //    get {
        //        var tran=new TransactionViewModel() { Model = App.Storage.Select<ITransaction>().FirstOrDefault() };
        //        return tran;
        //    }
        //}
        //public static CategoriesViewModel Categories { get {
        //    return new CategoriesViewModel();
        //}
        //}

        //public static AccountListViewModel AccountList
        //{
        //    get {
        //        var accounts = App.Storage.Select<IBankAccount>().ToList();

        //        return new AccountListViewModel() { Accounts = accounts, Selected = accounts[0] };
        //    }
        //}


        //public static EditAccountViewModel EditAccount
        //{
        //    get
        //    {
        //        var baccount=App.Storage.Select<IBankAccount>().FirstOrDefault(); 
        //        var vm=new EditAccountViewModel(){Model=baccount};

        //        return vm;
        //    }
        //}

        //public static StockAccountViewModel StockAccount {
        //    get { 
        //        var saccount=App.Storage.Select<IStockAccount>().FirstOrDefault();
        //        return new StockAccountViewModel() { Model=saccount};
        //    }
        //}

        //public static ContragentViewModel Contragent {
        //    get {
        //        var contragents = new ContragentViewModel();
        //        contragents.Selected = System.Linq.Enumerable.First(contragents.ContragentList as IEnumerable<IContragent>) as IContragent;
        //        return contragents;
        //    }
        //}

        //public static StockInvestmentViewModel StockInvestment {
        //    get {
        //        return new StockInvestmentViewModel() { Model = App.Storage.Select<IStockInvestment>().FirstOrDefault() };
        //    }
        //}


        //public static RelocateCategoryViewModel RelocateCategory {
        //    get {
        //        var vm = new RelocateCategoryViewModel();
        //        var categories = App.Storage.Select<ICategory>().ToList();
                
        //        vm.FromCategory = categories[0];
        //        vm.FromSubCategory = categories[0].SubCategoryList.FirstOrDefault();

        //        vm.ToCategory = categories[1];
        //        vm.ToSubCategory = categories[1].SubCategoryList.FirstOrDefault();

        //        return vm;
        //    }
        //}

        //public static RelocateContragentViewModel RelocateContragent
        //{
        //    get
        //    {
        //        var vm = new RelocateContragentViewModel();
        //        var contragents = App.Storage.Select<IContragent>().ToList();

        //        vm.FromContragent = contragents[0];

        //        vm.ToContragent = contragents[1];

        //        return vm;
        //    }
        //}

        //public static AssetListViewModel AssetList {
        //    get {
        //        var vm = new AssetListViewModel();
                
        //        return vm;
        //    }
        //}

        //public static AssetViewModel Asset {
        //    get {
        //        var vm = new AssetViewModel();
        //        vm.Model = App.Storage.Select<IAsset>().First();
        //        return vm;
        //    }
        //}
    }
}
